added SSCLI 1.0
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2010 / VBSoftKeyboard / NoActivate / UnsafeNativeMethods.vb
blob40825760eaaa12cc0aab2d5bd61e8ccbd3a87b34
1 '************************** Module Header ******************************'
2 ' Module Name: UnsafeNativeMethods.vb
3 ' Project: VBSoftKeyboard
4 ' Copyright (c) Microsoft Corporation.
5 '
6 ' These methods are used to get/set the foreground window.
7 '
8 '
9 ' This source is subject to the Microsoft Public License.
10 ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11 ' All other rights reserved.
13 ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
14 ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
15 ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
16 '************************************************************************'
19 Imports System
20 Imports System.Runtime.InteropServices
22 Namespace NoActivate
24 Friend NotInheritable Class UnsafeNativeMethods
26 ''' <summary>
27 ''' Retrieve a handle to the foreground window.
28 ''' http://msdn.microsoft.com/en-us/library/ms633505(VS.85).aspx
29 ''' </summary>
30 <DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
31 Public Shared Function GetForegroundWindow() As IntPtr
32 End Function
34 ''' <summary>
35 ''' Bring the thread that created the specified window into the foreground
36 ''' and activates the window.
37 ''' http://msdn.microsoft.com/en-us/library/ms633539(VS.85).aspx
38 ''' </summary>
39 <DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
40 Public Shared Function SetForegroundWindow(ByVal hWnd As IntPtr) As Boolean
41 End Function
43 ''' <summary>
44 ''' Determine whether the specified window handle identifies an existing window.
45 ''' http://msdn.microsoft.com/en-us/library/ms633528(VS.85).aspx
46 ''' </summary>
47 <DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
48 Public Shared Function IsWindow(ByVal hWnd As IntPtr) As Boolean
49 End Function
51 End Class
53 End Namespace